Skip to content

test(replay): Add Playwright tests for error-mode and error linking #7251

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Feb 22, 2023

Conversation

Lms24
Copy link
Member

@Lms24 Lms24 commented Feb 22, 2023

This PR adds four integration tests for replays where errors occur:

  • error mode:
    • error to session transition once the error occurs
    • if the error is dropped, it shouldn't be linked in the replay event (see test comment about the problem with this scenario)
  • session mode
    • if an error occurs, make sure it's linked in the replay event
    • unless the error is dropped

ref: #7044

@Lms24 Lms24 changed the title test(replay): Add tests for error-mode and error linking test(replay): Add Playwright tests for error-mode and error linking Feb 22, 2023
@Lms24 Lms24 force-pushed the lms/replay-pw-errors branch from 3a847ab to 3a12c53 Compare February 22, 2023 12:46

expect(event0).toEqual(
getExpectedReplayEvent({
contexts: { replay: { error_sample_rate: 1, session_sample_rate: 0 } },
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This also really shows a problem with how we handle this today 😅 we should address this with hooks as soon as we can, IMHO, as this is pretty confusing if you think about this 😅 (the test is good though to make clear this is expected)

Copy link
Member Author

@Lms24 Lms24 Feb 22, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, agreed. As we discussed on Monday, the test, in this case, shows how this behavior is unexpected to users. Will leave a note about this in the test file to clarify.

replay_type: 'error',
}),
);

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we stop the test here, I wonder? As I guess everything below here is kind of a duplicate of the other test(s) about error --> session mode switch?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup, good point. I also streamlined the session mode tests as they tested too much-duplicated stuff (classic case of copy 🍝)

Copy link
Member

@mydea mydea left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

very cool!

@Lms24 Lms24 added Type: Tests Package: replay Issues related to the Sentry Replay SDK labels Feb 22, 2023
@Lms24 Lms24 marked this pull request as ready for review February 22, 2023 14:33
@github-actions
Copy link
Contributor

size-limit report 📦

Path Size
@sentry/browser - ES5 CDN Bundle (gzipped + minified) 20.07 KB (+0.02% 🔺)
@sentry/browser - ES5 CDN Bundle (minified) 62.3 KB (0%)
@sentry/browser - ES6 CDN Bundle (gzipped + minified) 18.69 KB (+0.01% 🔺)
@sentry/browser - ES6 CDN Bundle (minified) 55.31 KB (0%)
@sentry/browser - Webpack (gzipped + minified) 20.41 KB (0%)
@sentry/browser - Webpack (minified) 66.76 KB (0%)
@sentry/react - Webpack (gzipped + minified) 20.44 KB (0%)
@sentry/nextjs Client - Webpack (gzipped + minified) 47.86 KB (0%)
@sentry/browser + @sentry/tracing - ES5 CDN Bundle (gzipped + minified) 26.94 KB (+0.01% 🔺)
@sentry/browser + @sentry/tracing - ES6 CDN Bundle (gzipped + minified) 25.2 KB (+0.01% 🔺)
@sentry/replay ES6 CDN Bundle (gzipped + minified) 42.61 KB (0%)
@sentry/replay - Webpack (gzipped + minified) 36.82 KB (0%)
@sentry/browser + @sentry/tracing + @sentry/replay - ES6 CDN Bundle (gzipped + minified) 60.24 KB (+0.01% 🔺)
@sentry/browser + @sentry/replay - ES6 CDN Bundle (gzipped + minified) 53.85 KB (+0.01% 🔺)

@Lms24 Lms24 merged commit 9c2c018 into develop Feb 22, 2023
@Lms24 Lms24 deleted the lms/replay-pw-errors branch February 22, 2023 15:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Package: replay Issues related to the Sentry Replay SDK Type: Tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants